class Solution(object):
    def reversePrefix(self, word, ch):
        id = word.find(ch)
        if id == -1:
            return word
        else:
            return word[:id + 1][::-1] + word[id + 1:]